<?php

class Form_Login_Index extends Base_Form
{
    public function init()
    {
        // Set the method for the display form to POST
        #$this->setAction(Zend_Controller_Front::getInstance()
        #            ->getRouter()->assemble(array('module'=> 'passport','controller'=> 'login')));
		
        $this->addElements(array(
            // Add username element
            new Zend_Form_Element_Text('username', array(
                'label'      => 'User',
                'class'      => array('ipt-t', 'no-ime'),
                'onblur'     => "this.className='ipt-t'",
                'onfocus'    => "this.className+=' ipt-t-focus'",
                'required'   => true,
                'filters'    => array('StringTrim'),
                'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(5,16))
                ),
				'decorators' => array(
                    'ViewHelper', 'Errors', 'Label',
                    array('HtmlTag', array('tag' => 'div', 'class' => 'fi'))
                )
            )),
            // Add password element
            new Zend_Form_Element_Password('password', array(
                'label'      => 'Pass',
                'class'      => array('ipt-t', 'no-ime'),
                'onblur'     => "this.className='ipt-t no-ime'",
                'onfocus'    => "this.className+=' ipt-t-focus'",
                'required'   => true,
                'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(6,16))
                ),
				'decorators' => array(
                    'ViewHelper', 'Errors', 'Label',
                    array('HtmlTag', array('tag' => 'div', 'class' => 'fi'))
                )
            )),
			// Add an submit element
            new Zend_Form_Element_Submit('submit', array(
                'label'      => 'Login',
                'class'      => 'ipt-b',
                'onmouseout' => "this.className='ipt-b'",
                'onmouseover'=> "this.className+=' ipt-b-hover'",
				'ignore'     => true,
				'Decorators' =>array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => array('fi', 'fi-btn'))))
            )),
        ));
        
        $this->button
            ->setOptions(array(
				'Decorators' =>array(),
            ));
    }
}
